package showtime.framework.net.message
{
	import showtime.framework.algorithm.collections.HashMap;
	
	import flash.utils.ByteArray;
	
	/** 
	 * @project showtime
	 * @author yinhao
	 * @date 2011-5-13
	 *
	 */
	
	public class NetMessage extends BaseMessage
	{
		public static const HEADER_INITIALIZE_GAME:int = 0x00000010;
		
		public static const HEADER_ECHO_SAMPLE:int = 0x00000001;
		/**
		 * Header:Heart beat check  
		 */		
		public static const HEADER_HEART_BEAT_CHECK:int = 0x00000006;		
		
		public var body:HashMap = null;
		
		public var header:int = 0;
			
		public function NetMessage()
		{
			initialize();
		}
		
		private function initialize():void
		{
			body = new HashMap();
		}
		
		override public function toBuffer():ByteArray
		{
			writeInt(header);
			
			writeObject(body.map);
			
			return this;
		}
	}
}